<!DOCTYPE html>
<html>
<head>
<?php include('comm/head.php');?>
<link href="<?php echo $this->config->item('static_url'); ?>css/index.css" rel="stylesheet" type="text/css" media="all" />
<script src="<?php echo $this->config->item('static_url'); ?>jscript/formValidator-4.1.1.js" type="text/javascript" charset="UTF-8"></script>
<script src="<?php echo $this->config->item('static_url'); ?>jscript/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<script src="<?php echo $this->config->item('static_url'); ?>jscript/DateTimeMask.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({theme:"126",submitOnce:true,formID:"form1",
		onError:function(msg){showMsg(msg);},
		submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...'
	});
	$("#email").formValidator({onShowFixText:"3~18个字符，包括字母、数字、下划线，以字母开头，字母或数字结尾",onShow:"请输入邮箱",onFocus:"邮箱6-100个字符,输入正确了才能离开焦点",onCorrect:"恭喜你,你输对了",defaultValue:"@"}).inputValidator({min:3,max:100,onError:"你输入的邮箱长度非法,请确认"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"你输入的邮箱格式不正确"})
	.ajaxValidator({
		dataType : "json",
		async : true,
		url : "<?php echo $this->config->base_url(); ?>chkemail_interface.html",
		success : function(data){
            if( data['uid'] == '0' ) return true;
            if( data['uid'] != '0' ) return false;
			return false;
		},
		buttons: $("#button"),
		error: function(jqXHR, textStatus, errorThrown){showMsg("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
		onError : "该email不可用，请更换email",
		onWait : "正在进行合法性校验，请稍候..."
	});
	$("#us").formValidator({onShowFixText:"3~25个字符，包括字母、数字、下划线，以字母开头，字母或数字结尾",onShowText:"请输入昵称",onShow:"请输入昵称,只有输入\"maodong\"才是对的",onCorrect:"该昵称可以注册"}).inputValidator({min:3,max:25,onError:"你输入的昵称长度不正确,请确认"}).regexValidator({regExp:"username",dataType:"enum",onError:"昵称格式不正确"}).ajaxValidator({
		dataType : "json",
		async : true,
		url : "<?php echo $this->config->base_url(); ?>chkemail_interface.html",
		success : function(data){
            if( data['uid'] == '0' ) return true;
            if( data['uid'] != '0' ) return false;
			return false;
		},
		buttons: $("#button"),
		error: function(jqXHR, textStatus, errorThrown){showMsg("服务器没有返回数据，可能服务器忙，请重试"+errorThrown);},
		onError : "该昵称不可用，请更换昵称",
		onWait : "正在进行合法性校验，请稍候..."
	});;
	$("#password1").formValidator({onShowFixText:"6~16个字符，包括字母、数字、特殊符号，区分大小写",onShow:"请输入密码",onFocus:"至少1个长度",onCorrect:"密码合法"}).inputValidator({min:6,max:16,empty:{leftEmpty:false,rightEmpty:false,emptyError:"密码两边不能有空符号"},onError:"密码长度错误,请确认"}).passwordValidator({compareID:"us"});
	$("#password2").formValidator({onShowFixText:"请再次输入密码",onShow:"输再次输入密码",onFocus:"至少1个长度",onCorrect:"密码一致"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"重复密码不能为空,请确认"}).compareValidator({desID:"password1",operateor:"=",onError:"2次密码不一致,请确认"});
	$("#tel").formValidator({onShowFixText:"密码遗忘或被盗时，可通过手机短信取回密码",onShow:"请输入手机号码",onFocus:"手机的长度必须是11位",onCorrect:"手机合法"}).inputValidator({min:11,max:11,onError:"手机号码必须为11位,请确认"}).regexValidator({regExp:"mobile",dataType:"enum",onError:"手机的格式不正确"});
});
function showMsg(msg) {
	$('#error_msg').html(msg);
	$(".overlay").css({'display':'block','opacity':'0.8'});		
	$(".showbox").stop(true).animate({'margin-top':'300px','opacity':'1'},200);
	setTimeout(function(){
		$(".showbox").stop(true).animate({'margin-top':'-250px','opacity':'0'},400);
		$(".overlay").css({'display':'none','opacity':'0'});
	},1000);
}
</script>
<style type="text/css">
.overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:998;width:100%;height:100%;_padding:0 20px 0 0;background:#f6f4f5;display:none;}
.showbox{position:fixed;top:0;left:50%;z-index:9999;opacity:0;filter:alpha(opacity=0);margin-left:-80px;}
*html,*html body{background-image:url(about:blank);background-attachment:fixed;}
*html .showbox,*html .overlay{position:absolute;top:expression(eval(document.documentElement.scrollTop));}
#AjaxLoading{border:1px solid #8CBEDA;color:#FF0000;font-size:14px;font-weight:500; font-family:"微软雅黑", "黑体", "宋体", Arial, tahoma}
#AjaxLoading div.loadingWord{width:auto;height:50px;line-height:50px;border:2px solid #D6E7F2;background:#fff; padding:0 10px 0 5px;}
#AjaxLoading img{margin:10px 15px;float:left;display:inline;}
</style>
</head>
<body id="aisn-home">
	<div id="homepage-box">
		<div class="page clearfix">
			<?php include 'comm/header.php';?>
            <hr size="1">
			<div class="col-sub">
				<div class="J-lazy-f">
					<h3></h3>
					<div class="cate-main"></div>
				</div>
			</div>

			<div class="col-main">
                <h3>注册用户</h3>
				<div id="b-sec-1" class="lead-sec J-lazy-f J-tab" style="height:auto;">
				<!--[if IE 6]><script>document.execCommand("BackgroundImageCache", false, true);</script><![endif]-->
<?php echo form_open('register.html',  array('name' => 'form1', 'id' => 'form1')); ?>
<br />
  <table style="font-size:12px; border:0px; width:630px;">
    <tr> 
      <td align="right">* 邮件地址:</td>
      <td><input type="text" id="email" name="email" style="width:120px" /></td>
      <td><div id="emailTip" style="width:280px"></div></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="2" valign="top"><div id="emailFixTip">6~18个字符，包括字母、数字、下划线，以字母开头，字母或数字结尾</div></td>
    </tr>
    <tr> 
      <td align="right">* 昵称:</td>
      <td><input type="text" id="us" name="nick_name" style="width:120px" value="" /></td>
      <td><div id="usTip" style="width:280px"></div></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="2" valign="top"><div id="usFixTip">6~12个字符，包括字母、数字、下划线，以字母开头，字母或数字结尾</div></td>
    </tr>
    <tr> 
      <td align="right">* 密码:</td>
      <td><input type="password" id="password1" name="password1" style="width:120px" /></td>
      <td><div id="password1Tip" style="width:280px"></div></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="2" valign="top"><div id="password1FixTip">6~16个字符，包括字母、数字、特殊符号，区分大小写</div></td>
    </tr>
    <tr>
      <td align="right">* 确认密码</td>
      <td><input type="password" id="password2" name="password2" style="width:120px" /></td>
      <td><div id="password2Tip" style="width:280px"></div></td>
    </tr>
    <tr>
      <td align="right">&nbsp;</td>
      <td colspan="2" valign="top"><div id="password2FixTip">请再次输入密码</div></td>
    </tr>
    
    <tr> 
      <td align="right">手机号码:</td>
      <td><input type="text" id="tel" name="mobile" style="width:120px" /></td>
      <td><div id="telTip" style="width:280px"></div></td>
    </tr>
    <tr>
      <td align="right" valign="top">&nbsp;</td>
      <td colspan="2" valign="top"><div id="telFixTip">密码遗忘或被盗时，可通过手机短信取回密码</div></td>
    </tr>
    <tr> 
      <td align="right" valign="top"></td>
      <td colspan="2" valign="top"><div class="ui-footer-sociality" style="width:560px;">
       <input type="submit" name="button" id="button" value="确定注册" class="submit">
       <input type="hidden" name="__H" id="__H" value="newUser" > </div>
      <a href="<?= $this->config->item('static_url'); ?>">返回首页</a> <a href="<?= $this->config->item('static_url'); ?>login.html">登录用户</a></td>
    </tr>
    <tr> 
      <td colspan="3"><div id="msTip" style="width:280px"></div></td>
    </tr>
  </table>
<?php echo form_close();?>
					<div id="output"></div>
                </div>
                <div class="lead-sec-l" id="lead-sec-l"></div>
			</div>

			<div class="section-seprator">&nbsp;</div>
			<div id="recommend-products" class="rp"></div>
			<div id="sponsor-products" class="clearfix"></div>
		</div>
	</div>
<?php include 'comm/footer.php';?>
<div class="overlay"></div>
<div id="AjaxLoading" class="showbox" style="margin-top:-100px;">
	<div class="loadingWord"><span class="ico-warning"></span><span id="error_msg">加载中，请稍候...</span></div>
</div>
<?php if($message!='') {?>
<script>showMsg('<?php echo $message; ?>')</script>
<?php }?>
</body>
</html>
